/////////////////////////////////////////////////////////////////////////////
// This file is part of the "Java-DAP" project, a Java implementation
// of the OPeNDAP Data Access Protocol.
//
// Copyright (c) 2007 OPeNDAP, Inc.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
/////////////////////////////////////////////////////////////////////////////
using System;
namespace NDODS.Util
{
	
	/// <summary> A minimal implementation of a globally-accessible set of Debug flags.</summary>
	
	public class Debug
	{
		//UPGRADE_ISSUE: Class hierarchy differences between 'java.util.TreeMap' and 'System.Collections.SortedList' may cause compilation errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1186'"
		//UPGRADE_TODO: Constructor 'java.util.TreeMap.TreeMap' was converted to 'System.Collections.SortedList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilTreeMapTreeMap'"
		private static System.Collections.SortedList map = new System.Collections.SortedList();
		private static bool debug = false;
		private static bool changed = true;
		
		static public bool isSet(System.String flagName)
		{
			System.Object val;
			if (null == (val = map[flagName]))
			{
				if (debug)
					System.Console.Out.WriteLine("Debug.isSet new " + flagName);
				map[flagName] = false;
				changed = true;
				return false;
			}
			
			return ((System.Boolean) val);
		}
		
		static public void  set_Renamed(System.String flagName, bool value_Renamed)
		{
			System.Object val;
			if (null == (val = map[flagName]))
			{
				changed = true;
			}
			map[flagName] = value_Renamed;
			if (debug)
				System.Console.Out.WriteLine("  Debug.set " + flagName + " " + value_Renamed);
		}
		
		static public void  clear()
		{
			//UPGRADE_TODO: Constructor 'java.util.TreeMap.TreeMap' was converted to 'System.Collections.SortedList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilTreeMapTreeMap'"
			//UPGRADE_ISSUE: Class hierarchy differences between 'java.util.TreeMap' and 'System.Collections.SortedList' may cause compilation errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1186'"
			map = new System.Collections.SortedList();
		}
		
        //static public SupportClass.SetSupport keySet()
        //{
        //    //UPGRADE_TODO: Method 'java.util.TreeMap.keySet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilTreeMapkeySet'"
        //    return new SupportClass.HashSetSupport(map.Keys);
        //}
	}
	
	/// <summary> $Log: Debug.java,v $
	/// Revision 1.1  2003/08/12 23:51:27  ndp
	/// Mass check in to begin Java-OPeNDAP development work
	/// 
	/// Revision 1.2  2002/09/13 21:12:08  caron
	/// add keySet()
	/// 
	/// Revision 1.1  2001/10/24 22:51:42  ndp
	/// *** empty log message ***
	/// 
	/// Revision 1.1.1.1  2001/09/26 15:36:47  caron
	/// checkin beta1
	/// 
	/// </summary>
}